package com.qd.system.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 人员岗位组织
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_person_station_org")
public class PersonStationOrg extends Model<PersonStationOrg> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "person_station_id", type = IdType.ASSIGN_ID)
    private String personStationId;
    /**
     * 组织编号
     */
    @TableField("org_id")
    private String orgId;
    /**
     * 岗位编号
     */
    @TableField("station_id")
    private String stationId;
    /**
     * 人员编号
     */
    @TableField("person_id")
    private String personId;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;

    public void freeData() {
        this.personStationId = null;
        this.orgId = null;
        this.stationId = null;
        this.personId = null;
        this.addTime = null;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        return o != null && getClass() == o.getClass();
    }

    @Override
    public int hashCode() {
        return Objects.hash(orgId, stationId, personId);
    }
}
